Skip to main content

Copy Selected Text

AutomatR.DefaultActivities.SystemClipboard.CopySelectedText

The "Copy Selected Text" activity in AutomatR allows you to copy the selected text from a specified process or the entire system clipboard. This is particularly useful for extracting text from a specific application or copying text from the global clipboard.

Properties

NameDescription
Input
Process NameSpecify the process name in the form of a string variable. This determines the source from which the text will be copied. If no process name is provided, the activity copies the selected text from the system clipboard. String variables containing the process name.
Misc
Display NameProvides a customizable name for the activity displayed in the workflow. The display name enhances clarity and organization within the automation project. String variable or argument containing the desired display name.
Optional
DelaySpecifies the amount of time (in seconds) to wait before executing the "Copy Selected Text" activity. This can be useful for handling synchronization issues. Integer variables containing the delay duration. Example: If the amount of time is 5 seconds, enter 5.
Output
ResultThe result will be stored in the form of a string variable and can be used in other activities. String variables containing the selected text.

How to use:

  1. Drag and drop the "Copy Selected Text" activity onto the workflow.
  2. Configure the properties by specifying the process name or leaving it blank for the system clipboard.
  3. Optionally, set the delay for the execution.
  4. Execute the workflow to copy the selected text.
  5. The selected text is stored in the variable specified in the "Result" property for further use in the workflow.

Example:

Consider an example where the "Copy Selected Text" activity is used to extract text from a specific application named "Notepad":

Copy Selected Text:
Display Name: "Copy Text from Notepad"
Process Name: "notepad"
Result: selectedText

In this example, the activity sets the focus on the "Notepad" application, copies the selected text using the "Ctrl+C" shortcut, and stores the result in the variable "selectedText" for further use in the workflow. If no process name is provided, the activity copies the text from the global clipboard.

Note: Make sure the specified process name matches the running application's process name, and the application has text selected.